<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search Form</title>

<meta name="generator" content="Adobe RoboHelp 10" />
<meta name="description" content="WebHelp 5.50" />
</head>
<style>
<!--
body {margin:0;}
-->
</style>
<body bgcolor="#c0c0c0">
<script  src="whver.js" charset="utf-8"></script>
<script  src="whmsg.js" charset="utf-8"></script>
<script  src="whutils.js" charset="utf-8"></script>
<script  src="whproxy.js" charset="utf-8"></script>
<script  src="whform.js" charset="utf-8"></script>
<script language="javascript1.2">
<!--
var gstrInput = "";
var gstrSyn = "";
var nNumRslt = 0 ;
var gbGiveAndSearch = 0;
var strEnableAndSearch = "Show results that include all search words";
var gbEnableAndSearch = 0;


function ftsLookup(bCR)
{
	if (bCR)
	{
		var strInput = document.FtsInputForm.keywordField.value.toUpperCase();
		if (strInput != "") {

            var objInfo = new Object();
            objInfo.strQuery = strInput;
            objInfo.ExtraInfo = '';

            var bEnableAndSearch = false;

            if(gbGiveAndSearch)
                bEnableAndSearch = (document.FtsInputForm.EnableAndSearch.checked == true);
            objInfo.ExtraInfo =  "gbEnableAndSearch="  + bEnableAndSearch ;

			var oMsg = new whMessage(WH_MSG_SEARCHFTSKEY, objInfo, null);
            notify(oMsg);
		    gstrInput = strInput;
		}

		if (gbMac) {
			document.FtsInputForm.keywordField.focus();
		}
	}
	return;
}

function onGetSearchs(oMsg)
{
    if(oMsg.oParam != "" && oMsg.oParam.sValue != "- Search -")
    {
        document.FtsInputForm.keywordField.value = oMsg.oParam.sValue;
		gfunLookUp(true);
    }
}

function beforeInit()
{
    init();
	var oParam = new Object();
	oParam.sValue = "";
	var oMsg = new whMessage(WH_MSG_GETSEARCHS, null, oParam);
	request(oMsg, onGetSearchs);
}

function window_unload()
{
	unregisterListener2(WH_MSG_SHOWTOC);
	unregisterListener2(WH_MSG_SHOWIDX);
	unregisterListener2(WH_MSG_SHOWFTS);
	unregisterListener2(WH_MSG_SHOWGLO);
	unregisterListener2(WH_MSG_SEARCHTHIS);
	unregisterListener2(WH_MSG_BACKUPSEARCH);
	unregisterListener2(WH_MSG_HILITESEARCH);
	unregisterListener2(WH_MSG_GETSEARCHSTR);
	unregisterListener2(WH_MSG_SETSYNSTR);
	unregisterListener2(WH_MSG_SETNUMRSLT);
	unregisterListener2(WH_MSG_GETNUMRSLT);
	unregisterListener2(WH_MSG_GETHIGHLIGHTINFO);
}

function onReceiveNotification(oMsg)
{
    if (oMsg.msgId == WH_MSG_SHOWFTS)
	{
		document.FtsInputForm.keywordField.focus();
	}
	else if (oMsg.msgId == WH_MSG_SHOWIDX ||
		oMsg.msgId == WH_MSG_SHOWTOC || 
		oMsg.msgId == WH_MSG_SHOWGLO)
	{
		document.FtsInputForm.keywordField.blur();
	}
	else if (oMsg.msgId == WH_MSG_SEARCHTHIS)
	{
		if (oMsg.iParam != "- Search -")
		{
			document.FtsInputForm.keywordField.value = oMsg.iParam;
			gfunLookUp(true);
		}
	}
	else if(oMsg.msgId == WH_MSG_SETSYNSTR)
	{
		gstrSyn = oMsg.iParam;
	}
	else if(oMsg.msgId == WH_MSG_SETNUMRSLT)
	{
		nNumRslt = oMsg.iParam;		
	}
	return true;
}

function onReceiveRequest(oMsg)
{
    if (oMsg.msgId == WH_MSG_BACKUPSEARCH)
	{
		if (gstrInput)
		{
			oMsg.oParam = gstrInput;
			gstrInput = "";
			gstrSyn = "";
			nNumRslt = 0 ;
			reply(oMsg);
			return false;
		}
	}
	else if (oMsg.msgId == WH_MSG_HILITESEARCH)
	{
		var bHiLite = (document.FtsInputForm.HiLite.checked == true);
		if (bHiLite == 1)
			oMsg.oParam = true; 
		else
			oMsg.oParam = false;
		reply(oMsg);
		return false;
	}
	else if (oMsg.msgId == WH_MSG_GETSEARCHSTR)
	{
		oMsg.oParam = "";
		if (oMsg.oParam != "- Search -")
		{
			oMsg.oParam = document.FtsInputForm.keywordField.value;
			oMsg.oParam += " " + gstrSyn;
		}	
		reply(oMsg);
		return false;
	}
	else if(oMsg.msgId == WH_MSG_GETNUMRSLT)
	{
		oMsg.oParam = nNumRslt;	
		reply(oMsg);
		return false;
	}
	else if(oMsg.msgId == WH_MSG_GETHIGHLIGHTINFO)
	{
	    oMsg.oParam.bHighlight = (document.FtsInputForm.HiLite.checked == true);
	    oMsg.oParam.nResults = nNumRslt;
	    oMsg.oParam.strTerms = document.FtsInputForm.keywordField.value;
	    if (oMsg.oParam.strTerms != "- Search -")
	    {
	        oMsg.oParam.strTerms += " " + gstrSyn;
	    }
	    reply(oMsg);
	    return false;
	}
	return true;
}

if (window.gbWhForm)
{
	registerListener2(WH_MSG_SHOWTOC);
	registerListener2(WH_MSG_SHOWIDX);
	registerListener2(WH_MSG_SHOWFTS);
	registerListener2(WH_MSG_SHOWGLO);
	registerListener2(WH_MSG_SEARCHTHIS);
	registerListener2(WH_MSG_BACKUPSEARCH);
	registerListener2(WH_MSG_HILITESEARCH);
	registerListener2(WH_MSG_GETSEARCHSTR);
	registerListener2(WH_MSG_SETSYNSTR);
	registerListener2(WH_MSG_SETNUMRSLT);
	registerListener2(WH_MSG_GETNUMRSLT);
	registerListener2(WH_MSG_GETHIGHLIGHTINFO);
	gfunLookUp = ftsLookup;
	gfunInit = null;
	gstrFormName = "FtsInputForm"
	gsTitle = "Type in the word(s) to search for:";
	gsTitle = "Type in the word(s) to search for:";
	gsHiliteSearchTitle = "Highlight search results";
	gsHiliteSearchTitle = "Highlight search results";
	gsMaxSearchTitle = "Search results per page" ;
	gsMaxSearchTitle = "Search results per page";
	setGoImage1("wht_go.gif");
	setBackgroundcolor("White");
	
	setBtnType("none");
	
	
	
	setGoText("Go");
	setFont("Title", "Microsoft Sans Serif","8pt","Black","Normal","Normal","none");
	
	
	var strHiliteSearchSetting = "enable,yellow,black";
	strHiliteSearchSetting = "enable,#b2b4bf,black";
	var searchSetting = strHiliteSearchSetting.match("^(.+),(.+),(.*)$");
	if(searchSetting != null && searchSetting[1] == "enable")
		setHighlightSearch(true);
    
    setSearchSetting(gbGiveAndSearch, gbEnableAndSearch, strEnableAndSearch);

	document.write(getFormHTML("fts"));
	writeFormStyle();
	window.onload = beforeInit;
	window.onunload=window_unload;
}
else
	document.location.reload();
//-->
</script>
</body>
</html>
